package everydayGrade.t5;

import org.junit.jupiter.api.Test;

/**
 * @Author: Siantar
 * @Date: 2023-11-23-14:27
 * @Description: 1.0
 */
public class T1410 {
    public String entityParser(String text) {
        String[][] str = new String[][]{{"&quot;", "\""}, {"&apos;", "'"}, {"&gt;", ">"}, {"&lt;", "<"}, {"&frasl;", "/"}, {"&amp;", "&"}};
        for (int i = 0; i < 6; i++) {
            text = text.replaceAll(str[i][0], str[i][1]);
        }
        return text;
    }

    @Test
    public void test() {
        String s = "&amp; is an HTML entity but &ambassador; is not.";
        System.out.println(entityParser(s));
    }
}
